package com.zadetk.helpyou.activities;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;

import com.zadetk.helpyou.R;
import com.zadetk.helpyou.adapter.ListViewAdapter;
import com.zadetk.helpyou.base.AbsActivity;
import com.zadetk.helpyou.base.BaseActivity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class PublishServiceSubActivity extends AbsActivity {

    private ListView mListView;
    private ListViewAdapter mLAdapter;
    private ArrayList<ArrayList<HashMap<String, Object>>> mData;
    private List<String> list = new ArrayList<>();

    @Override
    public int setView() {
        return R.layout.activity_publish_service_sub;
    }

    @Override
    public void initBasic(Bundle savedInstanceState) {
        initData();
        init();
    }

    private void init() {
        setTopTitle("选择服务项目");
        mListView = (ListView) findViewById(R.id.lv);
        mLAdapter = new ListViewAdapter(mData, PublishServiceSubActivity.this);
        mListView.setAdapter(mLAdapter);

    }

    private void initData() {
        mData = new ArrayList<ArrayList<HashMap<String, Object>>>();
        HashMap<String, Object> hashMap = null;
                ArrayList<HashMap<String, Object>> sonData;

                for (int i = 0; i < 6; i++) {
                    sonData = new ArrayList<HashMap<String, Object>>();
                    for (int k = 0; k < 6; k++) {
                        hashMap = new HashMap<String, Object>();
                        hashMap.put("son", "i=" + i + " ,k=" + k);
                        sonData.add(hashMap);
            }
            mData.add(sonData);
        }

    }


}
